import leave.LeaveStudent;
import leave.StudentList;
import shisheng.Common;
import shisheng.Student;
import shisheng.Teacher;

import java.util.Scanner;

public class Main {
    public static Common login() {
        System.out.print("请输入你的姓名:>");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.print("请输入你的身份[1.老师 2.学生]:>");
        int identity = scanner.nextInt();
        if (identity == 1) {
            return new Teacher(name);
        }else {
            return new Student(name);
        }
    }
    public static void main(String[] args) {
        StudentList studentList = new StudentList();
        Common common = login();
        while(true) {
            int ret = common.menu();
            common.work(ret,studentList);
        }
    }
}
